#com.kuaishou.nebula/com.yxcorp.gifshow.relation.user.activity.FollowingFriendActivity
#当前界面是否是微信运动排行榜
is_wewang_activity=0
itouched=0

#检查当前界面是否是微信运动排行榜
check_is_fensi_Activity ()
{

currentActivity=$(adb -s localhost:5555 shell dumpsys activity | grep ActivityRecord |head -n 1)
key="com.kuaishou.nebula/com.yxcorp.gifshow.relation.user.activity.FollowingFriendActivity"
if [[ $currentActivity == *$key* ]]
then 	
	#echo is wechat
	is_wewang_activity=1
else
	is_wewang_activity=0
	
fi
}
for ((m=1; m<300; m++))
	do	
        b=$(( $m % 20 ))
        if [ $b = 0 ] 
        then 
        echo "滑动 20单位休眠5秒"
        adb  -s localhost:5555 shell input swipe 300 1080 310 430
        sleep 5
        fi

        check_is_fensi_Activity
        if [[ is_wewang_activity -eq 1 ]] 
        then  
            #先将最下头像对齐
            echo "点击..."${m}
            adb -s localhost:5555 shell input tap 980 425
            #sleep 1
            echo "点击取消关注"${m}
            adb -s localhost:5555 shell input tap 650 1650
            #sleep 1
            echo "点击取消关注"${m}
            adb -s localhost:5555 shell input tap 650 2015
            #sleep 1
        else
            echo "当前非粉丝窗口，退出,清除粉丝"${m}
            break
        fi
    done
